# !/usr/bin/env python
# -*- coding: utf-8 -*-
# ///////////////////////////////////////////////////////////////
# @File    :   getImageFooterData.py
# @Time    :   2024/08/30 17:24:30
# @Author  :   kai.luo
# @Version :   1.0.0
# @Desc    :   None
# ///////////////////////////////////////////////////////////////

import re


class FooterInfo(object):
    def __init__(self, **kwarg) -> None:
        pass

    def getFooter(self, data):
        """_summary_

        Args:
            data (_type_): _description_
        """
        # print(f'parserFooterData---{data}')
        form_footer_dict = dict()
        for item in data:
            text = item[1][0]
            text_list = text.split('：')
            if len(text_list) >= 2:
                key = text_list[0]
                value = text_list[1]
                if re.findall(r'打印|日期|报告', key):
                    form_footer_dict.setdefault('报告日期', value)
                elif re.findall(r'检查', key):
                    form_footer_dict.setdefault('检查医师', value)
                elif re.findall(r'审核', key):
                    form_footer_dict.setdefault('审核医师', value)

        return form_footer_dict
